﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using QLChiTieu.DAL;
using Company.Product.Entity;
using Company.Product.DAL;

namespace QLChiTieu.BLL
{
    public class ChiTieu_Provider
    {
        IDbConnection dbConnection;

        public string ErrMsg;

        public ChiTieu_Provider(IDbConnection con)
        {
            dbConnection = con;
        }

        public ChiTieu_Provider()
        {
            dbConnection = DBConnectionFactory.GetDbConnection();
        }

        public KeHoachChiTieuList GetListByDuration(DateTime from, DateTime to)
        {
            if (from > to)
            {
                ErrMsg = "From cannot be larger than to";
                return null;
            }

            KeHoachChiTieuList list = null;

            KeHoachChiTieuDao dao = new KeHoachChiTieuDao(this.dbConnection);

            ////list = dao.selectByTime(from, to);

            return list;
        }
    }
}